package com.auxgroup.smarthome.business.service.inner;

import com.auxgroup.bridge.business.inner.dto.AppPushTemplateDto;
import com.auxgroup.bridge.business.inner.vo.AppPushTemplateVo;
import com.auxgroup.smarthome.business.service.AppPushTemplateInnerServiceFallback;
import com.auxgroup.smarthome.utils.PageContent;
import com.auxgroup.smarthome.web.ApiResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by lixiaoxiao on 17-10-16.
 */
@FeignClient(name="INNER-SERVICE", fallback = AppPushTemplateInnerServiceFallback.class)
public interface AppPushTemplateInnerService {
    @RequestMapping(value = "/inner/push/templates", method = RequestMethod.GET)
    ApiResponse<PageContent<AppPushTemplateVo>> findAppPushTemplate(@RequestParam("keyword") String keyword,
                                                                    @RequestParam("pushTimeStart") String pushTimeStart,
                                                                    @RequestParam("pushTimeEnd") String pushTimeEnd,
                                                                    @RequestParam("progress") Integer progress,
                                                                    @RequestParam("page") Integer page,
                                                                    @RequestParam("size") Integer size);

    @RequestMapping(value = "/inner/push/template", method = RequestMethod.POST)
    ApiResponse addAppPushTemplate(AppPushTemplateDto appPushTemplateDto);

    @RequestMapping(value = "/inner/push/template", method = RequestMethod.PUT)
    ApiResponse updateAppPushTemplate(AppPushTemplateDto dto, @RequestParam("templateId") String templateId);

    @RequestMapping(value = "/inner/push/template", method = RequestMethod.DELETE)
    ApiResponse deleteAppPushTemplate(@RequestParam("templateId") String templateId);

    @RequestMapping(value = "/inner/push/send", method = RequestMethod.POST)
    ApiResponse pushToJiGuangPaas(@RequestParam("templateId") String templateId);

    @RequestMapping(value = "/inner/push/sendnew", method = RequestMethod.POST)
    ApiResponse pushToJiGuangPaasNew(@RequestParam("templateId") String templateId);
}
